<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>AUI快速完成布局</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />

</head>

<body style="background:#fff;">
    <ul class="aui-list" style="border:none;padding-top:0">
        <li style="padding:0 1rem;margin:1.5rem 0;border:none;">
            <input id='account' type="text" placeholder="请输入手机号" style="border:1px solid #ccc;text-align:center;border-radius:1rem;">
        </li>
        <li style="padding:0 1rem;margin:1.5rem 0;border:none;">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-input">
                    <input id='code' type="number" placeholder="请输入验证码" style="border:1px solid #ccc;text-align:center;border-radius:1rem;">
                </div>
                <div class="aui-list-item-label" style="border:1px solid #ccc;border-radius:1rem;background:#ff4285;font-size:0.6rem;text-align:center;color:#fff;" onclick="getVerify()">
                    &nbsp;&nbsp;&nbsp;&nbsp;获取验证码
                </div>
            </div>
        </li>

        <!-- <li class="aui-list-item">
            <div class="aui-list-item-inner aui-list-item-center aui-list-item-btn">

                <div id='get_sns' class="aui-btn aui-btn-info aui-margin-r-5" tapmode onclick="getVerify()">点击获取验证码</div>
            </div>
        </li> -->
        <li class="" style="padding:0 1rem;margin:1.5rem 0;border:none;">

            <div tapmode onclick="register()" ; style="border-radius:1rem;border:1px solid #ccc;text-align:center;line-height:2rem;background:#ff4285;color:#fff;width:100%">下一步</div>


        </li>
    </ul>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="./conf/config.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
    apiready = function() {


    };
    //获取验证码
    function getVerify() {
        var username = $api.byId('account').value;
        if (username != '') {
            api.ajax({
                url: SITE_URL + 'index.php?m=api&c=appnew&a=send_code',
                method: 'post',
                data: {
                    values: {
                        "username": username
                    }
                }
            }, function(ret, err) {
              //alert(JSON.stringify(ret));
                if (ret.status == 1) {
                  api.toast({
                        msg: '验证码发送成功',
                        duration: 2000,
                        location: 'middle'
                    });
                } else {
                  alert(ret.msg);
                }
            });
        } else {
            alert('请填写手机号');
        }

    }
    //注册
    function register(){
        var username = $api.byId('account').value;
        var code = $api.byId('code').value;

        if (username == '') {
            alert('请填写手机号');
            return false;
        };
        if (code == '') {
            alert('请填写验证码');
            return false;
        };


            api.ajax({
                        url: SITE_URL + 'index.php?m=api&c=appnew&a=check_find_pwd',
                        method: 'post',
                        data: {
                            values: {
                                "username": username,
                                "code": code,

                            }
                        }
                    }, function(ret, err) {
                        //alert(JSON.stringify(ret));
                        if (ret.status == 1) {
                          api.openWin({
                              name: 'next_re_password',
                              url: './next_re_password.html',
                              pageParam: {
                                  username:username,
                                  userid:ret.data.userid,
                                  random:ret.data.random,
                              }
                          });
                        } else {
                              alert(ret.msg);
                        }
                    });
    }
</script>
<!-- <script type="text/javascript">
    function fnGetCheckSms() {
        var phone = $api.byId('account').value;
        if (phone != '') {
            $("#get_sns").css({
                background: "#cccccc",
                color: "#fff"
            }).html('正在发送...');
            api.ajax({
                url: SITE_URL+'index.php?m=api&c=appp&a=send_phcode',
                method: 'GET',
                data: {
                    values: {
                        "phone": phone
                    }
                }
            }, function(ret, err) {
                if (ret.status == 1) {
                    $("#get_sns").css({
                        background: "#cccccc",
                        color: "#fff"
                    }).html('发送成功...');
                }
            });
        } else {
            alert('请填写手机号');
        }
</script> -->

</html>
